<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->get('/users', 'UsersController@index');
    $router->get('/users/downline/{id}', 'UsersController@downline');
    $router->get('users/{id}/edit', 'UsersController@edit');
    $router->put('users/{id}', 'UsersController@update');
    $router->get('users/create', 'UsersController@create');
    $router->post('users/import', 'UsersController@import');
    $router->post('users/send', 'UsersController@send');

    $router->get('products', 'ProductsController@index');
    $router->get('products/create', 'ProductsController@create');
    $router->post('products', 'ProductsController@store');
    $router->get('products/{id}/edit', 'ProductsController@edit');
    $router->put('products/{id}', 'ProductsController@update');

    $router->get('orders', 'OrdersController@index')->name('admin.orders.index');
    $router->get('orders/{id}', 'OrdersController@index');
    $router->get('orders/{order}', 'OrdersController@show')->name('admin.orders.show');
    $router->post('orders/{order}/ship', 'OrdersController@ship')->name('admin.orders.ship');
    $router->post('orders/{order}/refund', 'OrdersController@handleRefund')->name('admin.orders.handle_refund');
    $router->get('categories', 'CategoriesController@index');
    $router->get('categories/create', 'CategoriesController@create');
    $router->get('categories/{id}/edit', 'CategoriesController@edit');
    $router->post('categories', 'CategoriesController@store');
    $router->put('categories/{id}', 'CategoriesController@update');
    $router->delete('categories/{id}', 'CategoriesController@destroy');
    $router->get('api/categories', 'CategoriesController@apiIndex');

    $router->get('banners', 'BannersController@index');
    $router->get('banners/create', 'BannersController@create');
    $router->get('api/products', 'ProductsController@apiIndex');
    $router->post('banners', 'BannersController@store');
    $router->get('banners/{id}/edit', 'BannersController@edit');
    $router->put('banners/{id}', 'BannersController@update');
    $router->delete('banners/{id}', 'BannersController@destroy');

    $router->get('plat','PlatformController@index');
    $router->get('plat/create', 'PlatformController@create');
    $router->post('plat', 'PlatformController@store');
    $router->get('plat/{id}/edit', 'PlatformController@edit');
    $router->put('plat/{id}', 'PlatformController@update');

    $router->get('cash','CashController@index');
    $router->get('cash/create', 'CashController@create');
    $router->post('cash', 'CashController@store');
    $router->get('cash/{id}/edit', 'CashController@edit');
    $router->put('cash/{id}', 'CashController@update');

    $router->get('users_count','UsersCountController@index');
    $router->get('sales_count','SalesCountController@index');
    $router->get('sale_rank','SaleRankController@index');
    $router->get('custome_rank','CustomeRankController@index');

    $router->get('/messages', 'MessagesController@index');
    $router->get('messages/create', 'MessagesController@create');
    $router->post('messages', 'MessagesController@store');
    $router->get('messages/{id}/edit', 'MessagesController@edit');
    $router->get('messages/user/{id}', 'MessagesController@user');
    $router->put('messages/{id}', 'MessagesController@update');
    $router->put('messages/{id}', 'MessagesController@update');
    $router->post('messages/updatemessage', 'MessagesController@updatemessage');
    $router->delete('messages/{id}', 'MessagesController@destroy');
    $router->get('api/users', 'UsersController@apiIndex');





});
